<template>
  <div>
    <div>父组件中显示内容:{{ parentMessage }}</div>
    <child @message-sent="handleMessage" :message="parentMessage"></child>
  </div>
</template>

<script setup>
import child from './child.vue';

function handleMessage(message) {
  console.log('接收到了子组件的消息:', message);
}

const parentMessage = '来自父组件的消息';
</script>